home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gdevcgmx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  5.2 KB  |  189 lines

  1. /* Copyright (C) 1995 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gdevcgmx.h,v 1.2 2000/09/19 19:00:12 lpd Exp $ */
  20. /* Internal definitions for CGM-writing library */
  21.  
  22. #ifndef gdevcgmx_INCLUDED
  23. #  define gdevcgmx_INCLUDED
  24.  
  25. #include "gdevcgml.h"
  26.  
  27. /* Define the internal representations of the CGM opcodes. */
  28. #define cgm_op_class_shift 7
  29. #define cgm_op_id_shift 5
  30. typedef enum {
  31.     /* Class 0 */
  32.     BEGIN_METAFILE = (0 << cgm_op_class_shift) + 1,
  33.     END_METAFILE,
  34.     BEGIN_PICTURE,
  35.     BEGIN_PICTURE_BODY,
  36.     END_PICTURE,
  37.     /* Class 1 */
  38.     METAFILE_VERSION = (1 << cgm_op_class_shift) + 1,
  39.     METAFILE_DESCRIPTION,
  40.     VDC_TYPE,
  41.     INTEGER_PRECISION,
  42.     REAL_PRECISION,
  43.     INDEX_PRECISION,
  44.     COLOR_PRECISION,
  45.     COLOR_INDEX_PRECISION,
  46.     MAXIMUM_COLOR_INDEX,
  47.     COLOR_VALUE_EXTENT,
  48.     METAFILE_ELEMENT_LIST,
  49.     METAFILE_DEFAULTS_REPLACEMENT,
  50.     FONT_LIST,
  51.     CHARACTER_SET_LIST,
  52.     CHARACTER_CODING_ANNOUNCER,
  53.     /* Class 2 */
  54.     SCALING_MODE = (2 << cgm_op_class_shift) + 1,
  55.     COLOR_SELECTION_MODE,
  56.     LINE_WIDTH_SPECIFICATION_MODE,
  57.     MARKER_SIZE_SPECIFICATION_MODE,
  58.     EDGE_WIDTH_SPECIFICATION_MODE,
  59.     VDC_EXTENT,
  60.     BACKGROUND_COLOR,
  61.     /* Class 3 */
  62.     VDC_INTEGER_PRECISION = (3 << cgm_op_class_shift) + 1,
  63.     VDC_REAL_PRECISION,
  64.     AUXILIARY_COLOR,
  65.     TRANSPARENCY,
  66.     CLIP_RECTANGLE,
  67.     CLIP_INDICATOR,
  68.     /* Class 4 */
  69.     POLYLINE = (4 << cgm_op_class_shift) + 1,
  70.     DISJOINT_POLYLINE,
  71.     POLYMARKER,
  72.     TEXT,
  73.     RESTRICTED_TEXT,
  74.     APPEND_TEXT,
  75.     POLYGON,
  76.     POLYGON_SET,
  77.     CELL_ARRAY,
  78.     GENERALIZED_DRAWING_PRIMITIVE,
  79.     RECTANGLE,
  80.     CIRCLE,
  81.     CIRCULAR_ARC_3_POINT,
  82.     CIRCULAR_ARC_3_POINT_CLOSE,
  83.     CIRCULAR_ARC_CENTER,
  84.     CIRCULAR_ARC_CENTER_CLOSE,
  85.     ELLIPSE,
  86.     ELLIPTICAL_ARC,
  87.     ELLIPTICAL_ARC_CLOSE,
  88.     /* Class 5 */
  89.     LINE_BUNDLE_INDEX = (5 << cgm_op_class_shift) + 1,
  90.     LINE_TYPE,
  91.     LINE_WIDTH,
  92.     LINE_COLOR,
  93.     MARKER_BUNDLE_INDEX,
  94.     MARKER_TYPE,
  95.     MARKER_SIZE,
  96.     MARKER_COLOR,
  97.     TEXT_BUNDLE_INDEX,
  98.     TEXT_FONT_INDEX,
  99.     TEXT_PRECISION,
  100.     CHARACTER_EXPANSION_FACTOR,
  101.     CHARACTER_SPACING,
  102.     TEXT_COLOR,
  103.     CHARACTER_HEIGHT,
  104.     CHARACTER_ORIENTATION,
  105.     TEXT_PATH,
  106.     TEXT_ALIGNMENT,
  107.     CHARACTER_SET_INDEX,
  108.     ALTERNATE_CHARACTER_SET_INDEX,
  109.     FILL_BUNDLE_INDEX,
  110.     INTERIOR_STYLE,
  111.     FILL_COLOR,
  112.     HATCH_INDEX,
  113.     PATTERN_INDEX,
  114.     EDGE_BUNDLE_INDEX,
  115.     EDGE_TYPE,
  116.     EDGE_WIDTH,
  117.     EDGE_COLOR,
  118.     EDGE_VISIBILITY,
  119.     FILL_REFERENCE_POINT,
  120.     PATTERN_TABLE,
  121.     PATTERN_SIZE,
  122.     COLOR_TABLE,
  123.     ASPECT_SOURCE_FLAGS,
  124.     /* Class 6 */
  125.     ESCAPE = (6 << cgm_op_class_shift) + 1,
  126.     /* Class 7 */
  127.     MESSAGE = (7 << cgm_op_class_shift) + 1,
  128.     APPLICATION_DATA
  129. } cgm_op_index;
  130.  
  131. /* Define the state of the CGM writer. */
  132.                         /*typedef struct cgm_state_s cgm_state; *//* in gdevcgml.h */
  133. struct cgm_state_s {
  134.     /* The following are set at initialization time. */
  135.     FILE *file;
  136.     cgm_allocator allocator;
  137.     /* The following are set by specific calls. */
  138.     cgm_metafile_elements metafile;
  139.     cgm_picture_elements picture;
  140.     int vdc_integer_precision;
  141.     cgm_precision vdc_real_precision;
  142.     cgm_color auxiliary_color;
  143.     cgm_transparency transparency;
  144.     cgm_point clip_rectangle[2];
  145.     cgm_clip_indicator clip_indicator;
  146.     int line_bundle_index;
  147.     cgm_line_type line_type;
  148.     cgm_line_width line_width;
  149.     cgm_color line_color;
  150.     int marker_bundle_index;
  151.     cgm_marker_type marker_type;
  152.     cgm_marker_size marker_size;
  153.     cgm_color marker_color;
  154.     int text_bundle_index;
  155.     int text_font_index;
  156.     cgm_text_precision text_precision;
  157.     cgm_real character_expansion_factor;
  158.     cgm_real character_spacing;
  159.     cgm_color text_color;
  160.     cgm_vdc character_height;
  161.     cgm_vdc character_orientation[4];
  162.     cgm_text_path text_path;
  163. /****** text_alignment ******/
  164.     int character_set_index;
  165.     int alternate_character_set_index;
  166.     int fill_bundle_index;
  167.     cgm_interior_style interior_style;
  168.     cgm_color fill_color;
  169.     cgm_hatch_index hatch_index;
  170.     int pattern_index;
  171.     int edge_bundle_index;
  172.     cgm_edge_type edge_type;
  173.     cgm_edge_width edge_width;
  174.     bool edge_visibility;
  175.     cgm_point fill_reference_point;
  176. /****** pattern_table ******/
  177.     cgm_vdc pattern_size[4];
  178. /****** color_table ******/
  179.             byte /*cgm_aspect_source */ source_flags[18];
  180.     /* The following change dynamically. */
  181. #define command_max_count 400    /* (must be even) */
  182.     byte command[command_max_count];
  183.     int command_count;
  184.     bool command_first;
  185.     cgm_result result;
  186. };
  187.  
  188. #endif /* gdevcgmx_INCLUDED */
  189.